package org.sob.blog.controller.user;

import lombok.extern.slf4j.Slf4j;
import org.sob.blog.pojo.BlogUser;
import org.sob.blog.response.ResponseResult;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserApi {
    /**
     * 初始化管理员账号-int-admin
     *
     * @return
     */
    @PostMapping("/admin-account")
    public ResponseResult initManageAccount(@RequestBody BlogUser blogUser) {
        log.info("user name == >" + blogUser.getUser_name());
        log.info("user password == >" + blogUser.getPassword());
        log.info("user email == >" + blogUser.getEmail());
        return ResponseResult.SUCCESS();
    }

    /**
     * 修改密码
     * @param userId
     * @param blogUser
     * @return
     */
    @PutMapping("/password/{userId}")
    public ResponseResult updatePassword(@PathVariable("userId") String userId, @RequestBody BlogUser blogUser) {
        return null;
    }

    /**
     * 获取用户信息
     * @param userId
     * @return
     */
    @GetMapping("/{userId}")
    public ResponseResult getUserInfo(@PathVariable("userId") String userId) {
        return null;
    }

    /**
     * 修改用户信息
     * @param userId
     * @return
     */
    @PutMapping("/{userId}")
    public ResponseResult updateUserInfo(@PathVariable("userId") String userId, @RequestBody BlogUser bloguser) {
        return null;
    }

    @GetMapping("/list")
    public ResponseResult listUsers(@RequestParam("page") int page, @RequestParam("size") int size) {
        return null;
    }
    @DeleteMapping("/{userId}")
    public ResponseResult DeleteUser(@PathVariable("userId") String userId) {
        return null;
    }
}
